import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsOptional } from 'class-validator';

export class UploadFolderDto {
  /**
   * 文件夹路径
   * @example 'E:/images'
   */
  @ApiProperty({
    description: '文件夹路径',
    example: 'E:/images',
  })
  @IsNotEmpty({ message: '文件夹路径不能为空' })
  @IsString({ message: '文件夹路径必须是字符串' })
  folderPath: string;

  /**
   * Cloudinary 目标文件夹
   * @example 'my-images'
   */
  @ApiProperty({
    description: 'Cloudinary 目标文件夹',
    example: 'my-images',
    required: false,
  })
  @IsOptional()
  @IsString({ message: '目标文件夹必须是字符串' })
  targetFolder?: string;

  /**
   * 上传选项
   */
  @ApiProperty({
    description: '上传选项',
    required: false,
  })
  @IsOptional()
  options?: {
    /**
     * 资源类型
     * @example 'image'
     */
    resource_type?: 'image' | 'video' | 'raw' | 'auto';

    /**
     * 其他选项
     */
    [key: string]: any;
  };
}
